namespace IAM.Interface.Model
{
    using IAM.Interface.Model.Interface;
    using System;
    using System.Text;

    public class AIDelegations : AbstractConvertObject, IConvertXml
    {
        private IAM.Interface.Model.AccountInfo _accountinfo = null;
        private IAM.Interface.Model.Delegations _delegations = null;

        public override object ConvertToObject()
        {
            this.AccountInfo = new IAM.Interface.Model.AccountInfo();
            this.AccountInfo.CurrentXmlNode = this.CurrentXmlNode.SelectSingleNode("AccountInfo");
            this.AccountInfo = (IAM.Interface.Model.AccountInfo) this.AccountInfo.ConvertToObject();
            this.Delegations = new IAM.Interface.Model.Delegations();
            this.Delegations.CurrentXmlNode = this.CurrentXmlNode.SelectSingleNode("Delegations");
            this.Delegations = (IAM.Interface.Model.Delegations) this.Delegations.ConvertToObject();
            return this;
        }

        public IAM.Interface.Model.AccountInfo AccountInfo
        {
            get
            {
                return this._accountinfo;
            }
            set
            {
                this._accountinfo = value;
            }
        }

        public IAM.Interface.Model.Delegations Delegations
        {
            get
            {
                return this._delegations;
            }
            set
            {
                this._delegations = value;
            }
        }

        public string XML
        {
            get
            {
                return (this.XMLBoday + this.XMLFinis);
            }
        }

        public string XMLBoday
        {
            get
            {
                StringBuilder _xml = new StringBuilder();
                _xml.Append(this.AccountInfo.XML);
                _xml.Append(this.Delegations.XML);
                return _xml.ToString();
            }
        }

        public string XMLFinis
        {
            get
            {
                return "";
            }
        }
    }
}

